<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.hbyj.util.ChangeTool"%>
<%@page import="com.hbyj.hbm.vo.Members"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Members mbInfo = (Members)request.getSession().getAttribute("SysUser");
String lyCode = "";
try{
	lyCode = mbInfo.getLyCode();
}catch(Exception e){
	 response.sendRedirect("login.jsp");
	 return;
}

SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date datetime = new Date();
String time = date.format(datetime);

int flag = ChangeTool.ChangeArea(lyCode).length();
String shengName = "";String shiName = "";String xianName = "";
String shengCode = "";String shiCode = "00";String xianCode = "00";
if(flag==2){
	shengCode = lyCode;
	shengName = ChangeTool.getFinalValue(lyCode);
}else if(flag==4){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
}else if(flag==6){
	shengCode = lyCode.substring(0,2)+"0000";
	shengName = ChangeTool.getFinalValue(shengCode);
	shiCode = lyCode.substring(0,4)+"00";
	shiName = ChangeTool.getFinalValue(shiCode);
	xianCode = lyCode;
	xianName = ChangeTool.getFinalValue(xianCode);
}
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'zskwh.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="style/zbCss/pageTable.css" rel="stylesheet" type="text/css" />
	<link href="style/zbCss/easyui_new.css" rel="stylesheet" type="text/css" />
		<link href="style/zbCss/icon.css" rel="stylesheet" type="text/css" />
		
		<script src="js/yjzsfunctiondlg/zbgl.js"  type="text/javascript"></script>
		<script src="lib/data.js" type="text/javascript"></script>
		<script src="lib/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="lib/easyui/jquery.easyui.min_new.js" type="text/javascript" ></script>
		
		<script type="text/javascript">
		 $(document).ready(function () {
		 //////////////值班人员维护加载select
               	setOption('china','sheng_zbry');
                $("#sheng_zbry").attr("disabled","disabled");
                setSltDefaultVal("sheng_zbry",<%=shengCode%>);
                changeShenItem(document.getElementById("sheng_zbry").value,'shi_zbry');
                $("#queryBtn_zbry").bind('click',function(){return queryZBRYByKeyword()});//值班人员管理维护查询按钮绑定时间
                initTblZBRY();//初始化值班人员表格
                //新增值班人员中角色和部门的初始化赋值
                initMemberRoleAndDepartment();
                //值班人员详情对话框
                $('#detailsDialog_zbry').dialog({
					draggable : true,
					top : 50,
					left : 100,
					title : "值班人员详情",
					collapsible : true
				});
                $("#detailsDialog_zbry").dialog("close");
                
                /////////值班人员新增加载select//////////
                setOption('china','sheng_addzbry');
                 $("#sheng_addzbry").attr("disabled","disabled");
                setSltDefaultVal("sheng_addzbry",<%=shengCode%>);
                changeShengItem(document.getElementById("sheng_addzbry").value,'addshi_zbry');
            });
            
		</script>
  </head>
  
  <body>
    <div id="wrapper">
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				style="margin-top: 0;">
				<tr>
					<td height="24" valign="middle" class="tab_title04">
						&nbsp;&nbsp;
						<img src="style/zbCss/images/icon_new.gif" width="12" height="16"
							align="middle" />
						&nbsp;&nbsp;值班人员管理
					</td>
				</tr>
			</table>
			<div id="tabsdiv" class="easyui-tabs" >
				<div title="值班人员维护" style="padding: 0px;" id="zbrywh">
						<table class="tab01" style="padding: 2 0 2 0">
							<tr>
								<td class="tad_td01" style="width: 80px" nowrap>
									省：
								</td>
								<td style="width: 200px" nowrap>
									<select id="sheng_zbry" onchange="changeShenItem(this.value,'shi_zbry')">
									<option  selected="selected" value="" >请选择省</option>
									</select>
								</td>
								
					
					
								<td class="tad_td01" nowrap>
									市：
								</td>
								<td style="width: 200px" nowrap>
									<select id="shi_zbry" onchange="changeShiItem(this.value,'xian_zbry')"><option  selected="selected" value="">请选择市</option></select>
								</td>
								<td class="tad_td01" nowrap>
									县：
								</td>
								<td style="width: 100px;">
									<select id="xian_zbry" ><option  selected="selected" value="">请选择县</option></select>
								</td>
								</tr>
								<tr>
								<td class="tad_td01" nowrap>
									姓名：
								</td>
								<td style="width: 100px;">
									<input id="qName_zbry" type="text">
								</td>
								<td>
									<input type="button" id="queryBtn_zbry" value="查询" class="btn_2z"
										onclick="statTaxCount();" />
								</td>
							</tr>
						</table>
											
					<input type="hidden" id="region" />
					<table id="tblZBRY" width="820px" height="550px"></table>
				</div>
				<div title="新增值班人员" style="padding: 0px;" id="zbryxz">
						
<table class="innerStyle" style="width:100%;">
<tr style="display: none;"><td><input type="hidden" id="addyjcz09000"/>
					<select id="sheng_addzbry"  onchange="changeShengItem(this.value,'addshi_zbry')"><option  selected="selected" value="" >请选择省</option></select>
		</td></tr>
		<tr><th colspan="4">新增值班人员</th></tr>
	<tr><td  class="tad_td01">值班单位</td><td><input type="text" id="addyjcz09020"/></td><td class="tad_td01">值班人员</td><td><input type="text" id="addyjcz09030"/></td></tr>
	<tr><td class="tad_td01">省市区划</td>
	<td><select id="addshi_zbry" 	onchange="changeShiItem(this.value,'addxian_zbry');">
	<option  selected="selected" value="-1">湖北省</option></select></td>
	<td class="tad_td01">县级区划</td><td>
	<select id="addxian_zbry" onchange="changeXianItem(this.value,'zhen')">
	<option  selected="selected" value="-1">请选择县</option></select></td></tr>
	<tr><td class="tad_td01">移动电话</td><td><input type="text" id="addyjcz09035"/></td><td class="tad_td01">性别</td><td><input type="text" id="addyjcz09040"/></td></tr>
	<tr><td class="tad_td01">办公电话</td><td><input type="text" id="addyjcz09050"/></td><td class="tad_td01">办公传真</td><td><input type="text" id="addyjcz09060"/></td></tr>
	<tr><%--<td>家庭电话</td><td><input type="text" id="addyjcz09070"/></td>--%>
	<td class="tad_td01">邮编</td><td><input type="text" id="addyjcz09080"/></td><td class="tad_td01">电子邮箱</td><td><input type="text" id="addyjcz09100"/></td></tr>
	<tr><td  class="tad_td01">通讯地址</td><td colspan="3"><input type="text" id="addyjcz09090" size="80"/></td></tr>
	<tr><td class="tad_td01">值班人员职务</td><td><input type="text" id="addyjcz09110"/></td><td class="tad_td01">备注</td><td><input type="text" id="addyjcz09120"/></td></tr>
	<tr><td class="tad_td01">登录名称</td><td><input type="text" id="addLoginName"/></td><td class="tad_td01">所属部门</td><td><select id="addUserDepartment" style="width:200px;"></select></td></tr>
	<tr><td class="tad_td01">功能角色</td><td><select id="addUserRole" style="width:200px;"></select></td>
	<tr><td class="tad_td01">登录密码</td><td><input type="text" id="addUserPass"/></td><td class="tad_td01">确认密码</td><td><input type="text" id="addUserPassSub"/></td></tr>
	<tr id="btnTr">
	
	<td colspan="4" align="center"><input  type="button" value="保存" class="btn_2z"
					onclick="addNewZBRY()" />
					<input type="button" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
	
				</div>
			</div>
			
			<!-- 值班人员详情对话框 -->
<div  id="detailsDialog_zbry" style="padding:5px;width:500px;height:300px;" >
	<input type="hidden" id="yjcz09000"/>
	<input type="hidden" id="yjcz09010"/>
	<table>
	
	<tr><td>值班单位</td><td><input type="text" id="yjcz09020"/></td><td>值班人员</td><td><input type="text" id="yjcz09030"/></td></tr>
	<tr><td>移动电话</td><td><input type="text" id="yjcz09035"/></td><td>性别</td><td><input type="text" id="yjcz09040"/></td></tr>
	<tr><td>办公电话</td><td><input type="text" id="yjcz09050"/></td><td>办公传真</td><td><input type="text" id="yjcz09060"/></td></tr>
	<tr><td>值班人员职务</td><td><input type="text" id="yjcz09110"/></td><td>邮编</td><td><input type="text" id="yjcz09080"/></td></tr>
	<tr><td>通讯地址</td><td><input type="text" id="yjcz09090"/></td><td>电子邮箱</td><td><input type="text" id="yjcz09100"/></td></tr>
	<tr><td >备注</td><td colspan="3"><input type="text" id="yjcz09120"/></td></tr>
	<tr id="btnTr">
	<td colspan="2" align="right"><input id="submitBtn"  type="button" value="保存" class="btn_2z"
					onclick="updateZBRY()" /></td>
					<td colspan="2"><input type="button" id="resetBtn" value="重置" class="btn_2z"
					onclick="resetEvent()" /></td></tr>
	</table>
	</div>
		
		</div>
  </body>
</html>
